package g_baseClass;

public class CloneTest {
	public CloneTest(){
		Point p = new Point();
		p.x = 100;
		p.y = 200;
		
		Point temp = (Point)p.clone();
		temp.x=50;
		temp.y=50;
		System.out.println("p.x=" + p.x);
		System.out.println("temp.x=" + temp.x);
	}
	public static void main(String[] args) {
		new CloneTest();

	}

}

class Point implements Cloneable{
	int x;
	int y;
	public Object clone(){
		Object o = null;
		try{
			o = super.clone();
		}catch(Exception ex){}
		return o;
	}
}